<?php

defined('MOODLE_INTERNAL') || die;

if ($hassiteconfig) 
{
    $ADMIN->add('tools', new admin_externalpage('toolcleanup', get_string('pluginname', 'tool_cleanup'),
            $CFG->wwwroot.'/'.$CFG->admin.'/tool/cleanup/index.php', 'moodle/site:config'));
    
    $settings = new admin_settingpage('toolcleanup_settings', get_string('pluginname_settings', 'tool_cleanup'));
    
    $name = 'tool_cleanup_is_cron';
    $title = get_string('switch_on_cron_title', 'tool_cleanup');
    $description = get_string('switch_on_cron_description', 'tool_cleanup');
    $default = 0;
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default);
    $settings->add($setting);
    
    $ADMIN->add('tools', $settings); 
}

